warframefandomcom_de-20200215-history
Modul:VoidByReward
WARFRAME Wiki Sorted Void Drop Table By Rewards --http://warframe.wikia.com/ --Originally written by User:NoBrainz --Heavily modified by User:Falterfire <-- The person to message if something goes wrong --Pulls from Module:Void/data --Data in Void:data is structure as local tierCol = 1 -- 1 = Tier (ex "Lith") local nameCol = 2 -- 2 = Name (ex "A1 Common*") (* means vaulted) local itemCol = 3 -- 3 = Item (ex "VASTO") local partCol = 4 -- 4 = Part (ex "RECEIVER") local p = {} local VoidData = mw.loadData( 'Module:Void/data' ) local Void = require( "Module:Void" ) local script = require( "Module:Icon" ) local Shared = require( "Module:Shared" ) -- Converts item names in data to proper names -- So for example 'LATRON' becomes 'Latron Prime' function p.getItemName(itemStr) caseItem = string.gsub(itemStr, "(%a)(%w_'*)", Shared.titleCase) if(itemStr ~= "FORMA") then caseItem = caseItem.." Prime" end return caseItem end -- Converts part names in data to proper casing function p.getPartName(partStr) return string.gsub(partStr, "(%a)(%w_'*)", Shared.titleCase) end function p.byReward(frame) local data = {} -- collect data for _, relic in pairs(VoidData"Relics") do for i, drop in pairs(relic.Drops) do local newObj = {Tier = relic.Tier, Name = relic.Name, Rarity = drop.Rarity, IsVaulted = relic.IsVaulted 1} if (datadrop.Item nil) then datadrop.Item = {} end if(datadrop.Itemdrop.Part nil) then datadrop.Itemdrop.Part = {} end table.insert(datadrop.Itemdrop.Part, newObj) end end local fullStr = " " return fullStr end --New function written by User:Falterfire --For Void Relics/ByRewards/SimpleTable function p.simpleRewardTable(frame) local data = {} --Collect data for each relic for _, relic in pairs(VoidData"Relics") do local vault = "Nein" if(relic.IsVaulted 1) then vault = "Ja" end --For each relic, need each drop for i, drop in pairs(relic.Drops) do --Custom objects are great local thisObj = {Item = drop.Item, Part = script.Deutsch(drop.Part), Tier = relic.Tier, Name = relic.Name, Rarity = script.Deutsch(drop.Rarity), IsVaulted = vault} table.insert(data, thisObj) end end local new function sorter(r1, r2) if(r1.Item r2.Item) then if(r1.Part r2.Part) then return r1.IsVaulted < r2.IsVaulted else return r1.Part < r2.Part end else return r1.Item < r2.Item end end table.sort(data, sorter) local rewards = {} -- Just manually sending back all table data -- Because this is easier than trying to format just rows local strTable = " " return strTable end function p.vaultedRelicsTable(frame) --Function by User:Falterfire --Finds all currently vaulted relics and auto-generates a table --Just hardcoding in the four types --Fine as long as somebody knows how to fix this if DE introduces 5th rarity local data = {"Lith" = {}, "Meso" = {}, "Neo" = {}, "Axi" = {}} -- collect data for _,relic in pairs(VoidData"Relics") do local tier = relic.Tier if(relic.IsVaulted 1) then table.insert(datatier, relic) end end --Setting up the table properly tableStr = " " --and send it back return tableStr end function p.byRelic(frame) --Added by User:Falterfire --First, setting up the table columns. tableStr = " " --And send it back return tableStr end function p.byRarity(frame) --Added by User:Falterfire --Twoooo Grakata. Or arguments. Whichever. local platform = frame.args ~= nil and frame.args1 or "PC" local checkTier = frame.args ~= nil and frame.args2 or "Lith" local data = {"Common" = {}, "Uncommon" = {}, "Rare" = {}} -- collect data for _,relic in pairs(VoidData"Relics") do local tier = relic.Tier local name = relic.Name --So first make sure this row is the right tier if(tier checkTier) then for _, drop in pairs(relic.Drops) do local rarity = drop.Rarity local item = drop.Item local part = drop.Part if(datararity"..part null) then datararity"..part = 1 end end end end --Now we can actually format the table --Starting with all the column headers tableStr = " " --and send it back return tableStr--, debugStr end return p